//
//  UIViewController+PublicMethod.m
//  SHB
//
//  Created by BenyLiang on 13-10-12.
//  Copyright (c) 2013年 BenyLiang. All rights reserved.
//

#import "UIViewController+PublicMethod.h"

@implementation UIViewController (PublicMethod)


#pragma mark NavigationBar Action

- (void)backButtonPressed {
    [self.navigationController popViewControllerAnimated:YES];
}

#pragma mark - Controll


//判断scrollview是否滑到底部
- (BOOL)scrollviewIsScrollToBottom:(UIScrollView *)scrollView {
    if (scrollView.contentOffset.y > scrollView.contentSize.height - scrollView.frame.size.height - 44 /*&& scrollView.contentOffset.y > scrollView.frame.size.height - 44*/) {
        return YES;
    }
    else
        return NO;
}

//判断scrollview是否滑到顶部
- (BOOL)scrollviewIsScrollToTop:(UIScrollView *)scrollView {
    if (scrollView.contentOffset.y <= -scrollView.contentInset.top) {
        return YES;
    }
    else
        return NO;
}


#pragma mark - View

//隐藏多余的tableview分割线
- (void)setExtraCellLineHidden:(UITableView *)tableView {
    UIView *view = [[UIView alloc] init];
    view.backgroundColor = [UIColor clearColor];
    [tableView setTableFooterView:view];
}


@end
